import Vue from 'vue'
import Vuex from 'vuex'

import vuexPersistedstate from "vuex-persistedstate"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    username:'',
    token:''
  },
  getters: {
  },
  mutations: {
    setusername(state,username){
      state.username = username

    },
    setToken(state,token){
      state.token = token
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[vuexPersistedstate()] // 2加入插件
})
